//
//  UIFont.swift
//  home_ios
//
//  Created by humin on 2016/12/13.
//  Copyright © 2016年 yihua. All rights reserved.
//

import UIKit

extension UIFont {

    class func SysFont(_ size: CGFloat) -> UIFont{
        return UIFont.systemFont(ofSize: size)
    }
    
    class func BoldSysFont(_ size: CGFloat) -> UIFont{
        return UIFont.boldSystemFont(ofSize: size)
    }
    
    class func LightDefaultFont (_ size: CGFloat) -> UIFont {
        return UIFont.customFont("PingFangSC-Light", size: size)
    }
    
    class func MediumDefaultFont (_ size: CGFloat) -> UIFont {
        return UIFont.customFont("PingFangSC-Medium", size: size)
    }
    
    class func RegularDefaultFont (_ size: CGFloat) -> UIFont {
        return UIFont.customFont("PingFangSC-Regular", size: size)
    }
    
    class func customFont (_ name:String, size: CGFloat) -> UIFont {
        var font = UIFont.init(name: name, size: size)
        if font == nil{
            font = UIFont.SysFont(size)
        }
        return font!
    }
    
}
